With the progress of computer technologies, the number of peripheral devices connected to a computer increases. Consequently the complexity of a computer system increases as well, which results in a demand in a more complicated system debugging in order to enhance stability of the computer system and to avoid system abnormal situations occurred during system operations. With the advancement of system debugging technologies, it is developed nowadays that by prompting the CPU to execute system management mode (SMM) in order to extract data in the registers of a computer system by means of triggering system management interrupt (SMI) via software by testing personnel, the state when an error is occurred in the computer system can be known and thereby the cause of the error in the computer system can be analyzed.
When a CPU is in the system management mode and data extraction from registers is not finished, if a return signal, such as one transmitted by a south bridge chip, is transmitted to the CPU, the CPU will modify the data stored in the registers of the computer system because a return signal is transmitted by system chip in order to reply the CPU that the execution event launched by the CPU's triggering command has been completed. As a result, instead of the data desired by testing personnel, the extracted data stored in the registers can possibly be data modified by the CPU, which will impair testing personnel debugging the computer system. Consequently, it is necessary to block return signals transmitted to the CPU until the completion of data extraction from registers when a CPU receives a system management interrupt signal and switches to the system management mode.
In addition, a system management interrupt signal can also be triggered by peripheral devices. Since the system management interrupt signal is not used for data extraction from registers, it is not necessary to block the return signal transmitted to the CPU. Currently, the method for determining blocking signals is to check the status registers of all peripheral devices and to identify if the system management interrupt signal is triggered by peripheral devices. If not, it means that the system management interrupt signal is triggered by software and thereby it is necessary to block the return signal transmitted to the CPU. However, the foregoing process of individually identifying status registers is quite time-consuming, and consumes hardware resources and costs in a computer system. Besides, at present day there is another method for blocking return signals, which, regardless of a system management interrupt signal triggered by peripheral devices or by software, blocks return signals directly. In this way, the computer system is prone to failure.
Accordingly, the present invention provides a method and an apparatus for blocking signals in order to solve the problems as described above. The method and the apparatus can easily judge if a system management interrupt signal is triggered by software for the purpose of data extraction from registers. Thereby a return signal can be determined to be blocked or not.